<%@ page language="java" contentType="text/html; charset=UTF-8"    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>用户编辑页面</title>
    	<link rel="stylesheet" href="${basePath}/css/plugins/hplus/bootstrap.min14ed.css?v=3.3.6">
		<link rel="stylesheet" href="${basePath}/css/plugins/bootstrap/bootstrap.min.css">
		<link rel="stylesheet" href="${basePath}/css/plugins/hplus/animate.min.css">
		<link rel="stylesheet" href="${basePath}/css/plugins/toastr/toastr.min.css">
		<link rel="stylesheet" href="${basePath}/css/newAdd.css"> 
		
		<script src="${basePath}/js/jquery/jquery.min.js?v=2.1.4"></script>
        <script src="${basePath}/js/bootstrap-3.3.6/bootstrap.min.js?v=3.3.6"></script>
        <script src="${basePath}/js/datapicker/bootstrap-datepicker.js"></script>
        <script src="${basePath}/js/angular-1.4.6/angular.min.js"></script>
        <script src="${basePath}/js/angular-1.4.6/angular-animate.min.js"></script>
        <script src="${basePath}/js/hplus/toastr.min.js"></script>
        <script src="${basePath}/js/common/kepdown.js"></script>
    <script type="text/javascript">
    	var basePath = "${basePath}";
    </script>
	   	<script src="${basePath}/system/sysUser/js/user_edit.js?t=<%=System.currentTimeMillis()%>"></script>
	<style type="text/css">
fieldset.scheduler-border {
    border: 1px groove #ddd !important;
    padding: 0 1.4em 1.4em 1.4em !important;
    margin: 20px 20px 20px 20px;
    -webkit-box-shadow:  0px 0px 0px 0px #000;
            box-shadow:  0px 0px 0px 0px #000;
    left:-100px;
}
legend.scheduler-border {
        font-size: 0.8em !important;
        font-weight: bold !important;
        text-align: left !important;
        width:auto;
        padding:0 10px;
        border-bottom:none;
    }
.droppable-active {
	background-color: #ffe !important
}

.tools a {
	cursor: pointer;
	font-size: 80%
}

.form-body .col-md-6,.form-body .col-md-12 {
	min-height: 400px
}

.draggable {
	cursor: move
}
input.ng-dirty.ng-invalid {
    border-color: #e9322d;
    -webkit-box-shadow: 0 0 6px #f8b9b7;
    -moz-box-shadow: 0 0 6px #f8b9b7;
    box-shadow: 0 0 6px #f8b9b7;
}
select.ng-dirty.ng-invalid {
    border-color: #e9322d;
    -webkit-box-shadow: 0 0 6px #f8b9b7;
    -moz-box-shadow: 0 0 6px #f8b9b7;
    box-shadow: 0 0 6px #f8b9b7;
} 
</style>
</head>
<body class="gray-bg">
	<div class="wrapper wrapper-content" ng-app="userEditApp"
		    ng-controller="userEditControl">
		<div class="row">
			<div class="col-sm-5" style="width: 100%; overflow-x: hidden">
				<div class="ibox float-e-margins">
					<div class="ibox-title">
						<ul class="breadcrumb">
							<li><a ng-click='backLst()' class="font-green">用户创建</a></li>
							<li class="active">编辑</li>
						</ul>
					</div>
					<div>
						<form id="userForm" name="userForm" action="" method="post"
							role="form" class="form-horizontal m-t">
							<input type="hidden" id="id" name="id" ng-model="id"
								value="<%= request.getParameter("userId")%>">
							<fieldset class='scheduler-border'>
								<legend class='scheduler-border'>账号信息：</legend>
								
								<div class='form-group draggable'>
									<label class='col-sm-3 control-label'>用户账号：</label>
									<div class='col-sm-5'>
										<input type="text" id="userAccount" name="userAccount" ng-model="userAccount" class="form-control" ng-maxlength='30' required>
										<span style='color: red' ng-show='userForm.userAccount.$dirty && userForm.userAccount.$invalid'>
											<span ng-show='userForm.userAccount.$error.required'>用户账号必填</span> 
											<span ng-show='userForm.userAccount.$error.maxlength'>用户账号长度不超过30</span>
										</span>
									</div>
									<div id="checkUserAccount" ng-show="checkUserAccount">
									   <font color="red">用户账号已存在!</font>
								    </div>
									<div>
										<span help-block m-b-none><font color='red' title='必填'>*</font>用户账号必填且长度不超过30</span>
									</div>
								</div>
								<div class='form-group draggable'>
									<label class='col-sm-3 control-label'>用户名：</label>
									<div class='col-sm-5'>
										<input type="text" id="userName" name="userName" ng-model="userName" class="form-control" ng-maxlength='20' required>
										<span style='color: red' ng-show='userForm.userName.$dirty && userForm.userName.$invalid'>
											<span ng-show='userForm.userName.$error.required'>用户名必填</span> 
											<span ng-show='userForm.userName.$error.maxlength'>用户名长度不超过20</span>
										</span>
									</div>
									<div>
										<span help-block m-b-none><font color='red' title='必填'>*</font>用户名必填且长度不超过20</span>
									</div>
								</div>
									<div class='form-group draggable'>
									<label class='col-sm-3 control-label'>密码：</label>
									<div class='col-sm-5'>
										<input type="password" ng-model="userPassword" class="form-control" ng-maxlength='20' required>
										<span style='color: red' ng-show='userForm.userPassword.$dirty && userForm.userPassword.$invalid'>
											<span ng-show='userForm.userPassword.$error.required'>密码必填</span> 
											<span ng-show='userForm.userPassword.$error.maxlength'>密码长度不超过20</span>
										</span>
									</div>
									<div>
										<span help-block m-b-none><font color='red' title='必填'>*</font>用户名必填且长度不超过20</span>
									</div>
								</div>
								<div class='form-group draggable'>
									<label class='col-sm-3 control-label'>邮箱：</label>
									<div class='col-sm-5'>
										<input type="text" id="userEmail" name="userEmail" ng-model="userEmail" class="form-control" ng-maxlength='30' required>
										<span style='color: red' ng-show='userForm.userEmail.$dirty && userForm.userEmail.$invalid'>
											<span ng-show='userForm.userEmail.$error.required'>邮箱必填</span> 
											<span ng-show='userForm.userEmail.$error.maxlength'>邮箱长度不超过30</span>
										</span>
									</div>
									<div>
										<span help-block m-b-none><font color='red' title='必填'>*</font>邮箱必填且长度不超过30</span>
									</div>
								</div>
								
								<div class='form-group draggable'>
									<label class='col-sm-3 control-label'>电话：</label>
									<div class='col-sm-5'>
<!-- 										<input type="text" id="userPhone" name="userPhone" ng-model="userPhone" class="form-control" 
										ng-pattern='/^[1-9]+[0-9]*$/' required> -->
										<input type="text" id="userPhone" name="userPhone" ng-model="userPhone" class="form-control" 
										ng-pattern='/^(\d{11})$|^(\d{3,5}[-]?\d{6,8})$/' required>
										<span style='color: red' ng-show='userForm.userPhone.$dirty && userForm.userPhone.$invalid'>
											<span ng-show='userForm.userPhone.$error.required'>电话必填</span> 
											<span ng-show='userForm.userPhone.$error.pattern'>只能输入数字</span> 
										</span>
									</div>
									<div>
										<span help-block m-b-none><font color='red' title='必填'>*</font>电话必填数字且超度不超过11</span>
									</div>
								</div>
							<!-- 	<div class='form-group draggable'>
									<label class='col-sm-3 control-label'>手机：</label>
									<div class='col-sm-5'>
										<input type="text" id="userTelephone" name="userTelephone" ng-model="userTelephone" class="form-control" 
										ng-pattern='/^[1-9]+[0-9]*$/' ng-maxlength='11' required>
										<span style='color: red' ng-show='userForm.userTelephone.$dirty && userForm.userTelephone.$invalid'>
											<span ng-show='userForm.userTelephone.$error.required'>手机必填</span> 
											<span ng-show='userForm.userTelephone.$error.pattern'>只能输入数字</span> 
											<span ng-show='userForm.userTelephone.$error.maxlength'>手机长度不超过11</span>
										</span>
									</div>
									<div>
										<span help-block m-b-none><font color='red' title='必填'>*</font>手机必填数字且超度不超过11</span>
									</div>
								</div> -->								
								<div class='form-group draggable'>
									<label class='col-sm-3 control-label'>部门名称：</label>
									<div class='col-sm-5'>
										<input type="text" id="upname" name="organizaName"  ng-model="organizaName" class="form-control">
										<input type='hidden' id='upcode' name='organizationId' ng-model='organizationId' class='form-control'>
									</div>
									<div>
										<span style='color: red'
											ng-show='userForm.organizaName.$dirty && userForm.organizaName.$invalid'>
											<span ng-show='userForm.organizaName.$error.required'>部门名称必填</span>
										</span>
									</div>
									<div>
									    <span><font color='red' title='必填'>*</font></span>
										<button class='btn btn-primary' type='button'
											data-toggle='modal' ng-click='getOrganiza()'>选择</button>
										<div class='modal fade' id='organiza' tabindex='-1'
											role='dialog' aria-labelledby='myModalLabel'
											aria-hidden='true'>
											<div class='modal-dialog'>
												<div class='modal-content'></div>
											</div>
										</div>
									</div>
								</div>	
						<!-- 	<div class="form-group draggable">
								<label class="col-sm-3 control-label">用户备注：</label>
								<div class="col-sm-5">
									<textarea id="userRemark" name="userRemark" ng-model="userRemark"
										class="form-control"></textarea>
								</div>
							</div> -->								
							</fieldset>

							<div class="hr-line-dashed"></div>
							<div class="form-group draggable">
								<div class="col-sm-5 col-sm-offset-3">
									<button class="btn btn-primary" type="button"
										ng-click="EditModel()">保存修改</button>
									<button class="btn btn-primary" type="button"
										ng-click="backLst()">取消修改</button>
								</div>
							</div>
						</form>
					</div>
				</div>
			</div>
		</div>
	</div>
</body>
<script>
    toastr.options = {
		  "closeButton": false,
		  "debug": false,
		  "progressBar": true,
		  "positionClass": "toast-top-right",
		  "onclick": null,
		  "showDuration": "400",
		  "hideDuration": "1000",
		  "timeOut": "3000",
		  "preventDuplicates": true,
		  "extendedTimeOut": "1000",
		  "showEasing": "swing",
		  "hideEasing": "linear",
		  "showMethod": "fadeIn",
		  "hideMethod": "fadeOut"
		}
</script>
</html>
